function [sitenm] = get_sitename(varargin)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% THIS FUNCTION RETURNS RWQ SITE NAMES. WHEN CALLED WITH NO OPTIONAL 
% ARGUMENT, THIS FUNCTION RETURNS THE FULL 
% LIST OF RWQ SITE NAMES. AN OPTION IS GIVEN TO RETURN SITE NAME SORTED 
% BY TYPE
%
% OPTIONAL ARGUMENT:  'beach' or 'bay': returns only beach or bay 
% 
% OUTPUT :  sitenm : cell array of RWQ site names
%
% EXAMPLE: sitenm = get_sitename %returns the full list of sites
%          sitenm = get_sitename('beach') %returns list of beach sites
% 
% Author: Benedicte Pasquer, IMOS/eMII (http://imos.org.au/)
% email: benedicte.pasquer@utas.edu.au
% May 2013   
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

load Bays_n_Beaches
if nargin > 1,error('Too many arguments'),end
    
if isempty(varargin)
    
    sitenm = [BAYS ; BEACHES];
    
elseif strcmp(varargin,'beach')==1
    
    sitenm = BEACHES;
    
elseif strcmp(varargin,'bay')==1
    
    sitenm = BAYS;
    
else
    error('Unknown option')
end